package com.itheima.d2_regex;

import java.util.Arrays;

public class RegexTest5 {
    public static void main(String[] args) {
        String s1 ="古力娜扎113123马尔扎哈";
        System.out.println(s1.replaceAll("\\w+", "-"));

        String s2 ="我我我爱爱编程程";
        System.out.println(s2.replaceAll("(.)\\1+", "$1"));

        String s3 ="古力娜扎113123马尔扎哈";
        String[] names = s3.split("\\w+");
        System.out.println(Arrays.toString(names));
    }
}
